<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:pe="http://primefaces.org/ui/extensions"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>Mérés napló - Hozzáadás</title>
</h:head>

<h:body>
	<h:outputScript library="js" name="calendar_hu.js" />
	<h:form id="addMeasurementJournalEntryForm">
		<h:panelGrid columns="3">
			<p:outputLabel value="Mérés" for="typeInput" />
			<p:selectOneMenu id="typeInput"
				value="#{addMeasurementDialog.measurement.measurementType}"
				effect="fade">
				<f:converter binding="#{measurementTypeConverter}" />
				<f:selectItems value="#{measurementTypeService.findAll()}"
					var="type" itemLabel="#{type.name}" itemValue="#{type}" />
			</p:selectOneMenu>
			<p:message for="typeInput" />
			<p:outputLabel value="Időpont" for="dateInput" />
			<p:calendar id="dateInput" locale="hu"
				value="#{addMeasurementDialog.measurement.date}"
				showButtonPanel="true" pattern="yyyy.MM.dd HH:mm" stepMinute="5"
				yearRange="c-1:c+1" />
			<p:message for="dateInput" />
			<p:outputLabel value="Érték" for="valueInput" />
			<pe:inputNumber id="valueInput" decimalPlaces="2"
				value="#{addMeasurementDialog.measurement.value}" />
			<p:message for="valueInput" />
		</h:panelGrid>

		<p:commandButton value="Mentés" process="@form" id="saveButton" update="@form"
			action="#{addMeasurementDialog.save()}"
			actionListener="#{addMeasurementDialog.close()}" />
	</h:form>
</h:body>

</html>
